package com.jinbai.service;

import com.jinbai.dao.ArticleDao;
import com.jinbai.model.ArticleListResult;
import com.jinbai.model.User;

public class ArticleListResultService {
    public ArticleListResult articleListResult(User currentUser) {
        ArticleDao articleDao = new ArticleDao();
        ArticleListResult articleListResult = new ArticleListResult();

        articleListResult.currentUser = currentUser;
        articleListResult.articleCount = articleDao.selectArticleCountByUid(currentUser.uid);
        articleListResult.typeCount = articleDao.selectTypeCountByUid(currentUser.uid);
        articleListResult.articleList = articleDao.selectArticleListByUid(currentUser.uid);
        return articleListResult;
    }
}
